package com.example.alee.mybatis.springmybatis.mapper;

import com.example.alee.mybatis.springmybatis.po.ArticlePo;
import com.example.alee.mybatis.springmybatis.provider.SqlProvider;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.SelectProvider;

import java.time.LocalDateTime;

public interface ArticleRepository {


    //使用提供者查询
    @SelectProvider(type = SqlProvider.class, method = "selectArticle")
    ArticlePo selectByPrimary(Integer id);

    //提供者进行修改
    @SelectProvider(type = SqlProvider.class, method = "updateArticleTime")
    int updateTimePrimary(LocalDateTime newTime, Integer id);


    @InsertProvider(type = SqlProvider.class, method = "insertArticle")
    int insertArticle(ArticlePo articlePo);


    @DeleteProvider(type = SqlProvider.class, method = "deleteArticleById")
    int deleteArticleById(Integer id);
}
